package com.oj.sort;

import java.util.Scanner;

public class CountSort {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int num = scanner.nextInt();
            int[] arr = new int[num];
            for (int i = 0; i < num; i++) {
                arr[i] = scanner.nextInt();
            }
            int[] res = sort(arr, num);
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i < num; i++) {
                builder.append(" ").append(res[i]);
            }
            System.out.println(builder.substring(1));
        }
    }

    public static int[] sort(int[] arr, int num) {
        int[] res = new int[num];
        //1.求出数组的最大值和最小值
        int min = arr[0], max = arr[0];
        for (int i = 0; i < num; i++) {
            if (min > arr[i]) {
                min = arr[i];
            }
            if (max < arr[i]) {
                max = arr[i];
            }
        }
        //2.计算数组中所有元素所属区间长度; 并计数数组中每个元素出现的个数
        int k = max - min + 1;
        int[] tmpArr = new int[k];
        for (int i = 0; i < num; i++) {
            tmpArr[arr[i] - min]++;
        }
        for (int i = 0, j = 0; i < k; i++) {
            while (tmpArr[i]-- > 0) {
                res[j++] = min + i;
            }
        }
        return res;
    }
}
